package com.ai.bitcoin.controller;

import com.ai.bitcoin.bo.BccNewsTop5BO;
import com.ai.bitcoin.common.resp.ResponseEntity;
import com.ai.bitcoin.enums.ResponseEnum;
import com.ai.bitcoin.jpa.service.BccNewsService;
import com.ai.bitcoin.vo.BccNewsTop5VO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * @description: 舆情
 * @author: gulj
 * @create: 2018-08-02 22:04
 **/
@RestController
@RequestMapping("/bccNews")
public class BccNewsController {

    @Autowired
    private BccNewsService bccNewsService;

    @PostMapping("/getTop3BccNewsByBccId")
    public ResponseEntity<BccNewsTop5VO> getTop3BccNewsByBccId(@RequestBody @Valid BccNewsTop5BO newsTop5BO) {
        BccNewsTop5VO bccNewsTop5VO = bccNewsService.getTop3BccNewsBccId(newsTop5BO);
        return new ResponseEntity<>(ResponseEnum.SUCCESS, bccNewsTop5VO);
    }
}
